﻿@using Texts = MvcTemplate.Resources.Views.Administration.Accounts.AccountView.Texts
@using MvcTemplate.Resources.Views.Auth.AccountLoginView

@model AccountLoginView

<div class="title text">@Pages.AuthLogin</div>
<div class="separator"></div>

@using (Html.BeginForm())
{
    @Html.Partial("_AuthAlerts")

    @Html.AntiForgeryToken()
    <div class="auth-content">
        <div class="input-group">
            <span class="fa fa-user"></span>
            @Html.TextBoxFor(model => model.Username, new { placeholder = Titles.Username })
            <span class="input-error fa fa-warning"></span>
        </div>
        <div class="input-group">
            <span class="fa fa-lock"></span>
            @Html.PasswordFor(model => model.Password, new { placeholder = Titles.Password })
            <span class="input-error fa fa-warning"></span>
        </div>
        @if (GlobalizationManager.Languages.Supported.Length > 1)
        {
            String query = Request.QueryString.Count > 0 ? "?" + Request.QueryString : "";

            <div class="input-group">
                <span class="fa fa-globe"></span>
                <div class="language-container dropdown-toggle" data-toggle="dropdown">
                    <span class="current-language">
                        <img src="@Url.Content(String.Format("~/Images/Flags/{0}.gif", GlobalizationManager.Languages.Current.Abbreviation))" width="16" height="11" alt="">
                        @GlobalizationManager.Languages.Current.Name
                    </span>
                    <span class="caret"></span>
                </div>
                <ul class="dropdown-menu" role="menu">
                    @foreach (Language language in GlobalizationManager.Languages.Supported)
                    {
                        <li>
                            <a href="@(Url.Action("Login", new { language = language.Abbreviation }) + query)">
                                <img src="@Url.Content(String.Format("~/Images/Flags/{0}.gif", language.Abbreviation))" width="16" height="11" alt="">
                                @language.Name
                            </a>
                        </li>
                    }
                </ul>
            </div>
        }
    </div>
    <button type="submit" class="btn btn-primary">@Actions.Login</button>
}

<div class="separator"></div>
<div class="auth-actions">
    <a class="text fa fa-unlock-alt" href="@Url.Action("Recover")" data-toggle="tooltip" data-original-title="@Texts.LostPassword" data-placement="bottom"></a>
</div>
